Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*_member_create don't raise validation errors #3108

Merged
merged 4 commits into from Jun 15, 2016

Conversation

amercader
Copy link
Member

organization_member_create and group_member_create don't raise validation errors if one of the parameters is missing (id, username or role, all mandatory).

This leads to confusing failures when submitting eg a key with an extra space ("username "):

(ProgrammingError) can't adapt type 'Missing' 'SELECT "user".password AS user_password, "user".id AS user_id, "user".name AS user_name, "user".openid AS user_openid, "user".fullname AS user_fullname, "user".email AS user_email, "user".apikey AS user_apikey, "user".created AS user_created, "user".reset_key AS user_reset_key, "user".about AS user_about, "user".activity_streams_email_notifications AS user_activity_streams_email_notifications, "user".sysadmin AS user_sysadmin, "user".state AS user_state \\nFROM "user" \\nWHERE "user".name = %(name_1)s ORDER BY "user".name \\n LIMIT %(param_1)s' {'name_1': <ckan.lib.navl.dictization_functions.Missing object at 0x7fb32056be10>, 'param_1': 1}

Add not_missing to the schema and raise the errors on the action. Adds
some tests as well
@@ -151,7 +151,6 @@ def setup_class(cls):

@classmethod
def teardown_class(cls):
p.unload('image_view')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened here, I pushed a commit fixing it

amercader added a commit that referenced this pull request Jun 15, 2016
@wardi wardi merged commit eb943c9 into master Jun 15, 2016
k-nut pushed a commit to k-nut/ckan that referenced this pull request Jul 4, 2016
Add not_missing to the schema and raise the errors on the action. Adds
some tests as well
k-nut pushed a commit to k-nut/ckan that referenced this pull request Jul 4, 2016
k-nut pushed a commit to k-nut/ckan that referenced this pull request Jul 4, 2016
k-nut pushed a commit to k-nut/ckan that referenced this pull request Jul 4, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
Add not_missing to the schema and raise the errors on the action. Adds
some tests as well
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
Add not_missing to the schema and raise the errors on the action. Adds
some tests as well
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
Add not_missing to the schema and raise the errors on the action. Adds
some tests as well
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
@smotornyuk smotornyuk deleted the 3108-validation-errors-on-member-create branch December 19, 2018 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants